package com.luo.controller;

import com.luo.service.CarService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/car")
public class CarController {

    @Resource
    private CarService carService;

    @RequestMapping(value = "/selectCarList",method = RequestMethod.GET)
    public Map<String,Object> selectCarList(){
        return carService.selectCarList();
    }

    @RequestMapping(value = "/delete",method = RequestMethod.POST)
    public Map<String,Object> delete(@RequestParam Integer id){
        return carService.delete(id);
    }

    @RequestMapping(value = "/selectCars",method = RequestMethod.GET)
    public Map<String,Object> selectCars(){
        return carService.selectCars();
    }
}
